<%@page import="Entity.Contrathabitat"%>
<%@page import="Session.ContratHabitatSessionLocal"%>
<%@page import="javax.ejb.EJBException"%>
<%@page import="Entity.SinistreHabitat"%>
<%@page import="java.util.List"%>
<%@page import="Session.SinistreHabitatSessionLocal"%>
<%@page import="javax.naming.InitialContext"%>
<%@ page pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Détails du contrat</title>
       <link type="text/css" rel="stylesheet" href="form.css" />
		<style type="text/css">
		  body {
			padding-top: 160px;
			padding-bottom: 40px;
		  }
		</style> 
    </head>
    <body>
        <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="navbar-inner">
		<div class="container">
                    <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
                    </button>
                    <a class="brand" id="logo" href="#">Assur'Tout</a>
                    <div class="nav-collapse collapse">
                        <ul class="nav">
                            <li><a href="ActionRedacteur.jsp">Accueil</a></li>
                            <li><a href="#about">Gérer un contrat</a></li>
                            <li class="active"><a href="#contact">Gérer un sinistre</a></li>
                            <li><a href="#contact">Se déconnecter</a></li>
			</ul>
                    </div>
		</div>
            </div>
	</div>
        <div class="container">
             <div class="hero-unit" align=center>
		<h1> Détails du contrat </h1>
             </div>
            
            <% String num = (String) session.getAttribute("contrat");
            System.out.println(num);
            InitialContext ic = new InitialContext();
            ContratHabitatSessionLocal rsl = (ContratHabitatSessionLocal) ic.lookup("java:comp/env/ContratHabitatSessionLocal");
            Contrathabitat c = rsl.getContrat(num);
            String t; 
            if(c.getIncendie())  t = "oui";
            else t = "Non";
            String v;
            if(c.getVol())  v = "oui";
            else v = "Non";
            String r;
            if(c.getDegatEau())  r = "oui";
            else r = "Non";      
             String w;
            if(c.getBienPrecieux())  w = "oui";
            else w = "Non";   
 %>
      
      
      <p>
          
          Code Postal : <%= c.getCodepostal() %><br/><br/>
                    
          Surface : <%= c.getSurface() %> mètres carrés. <br/><br/>
          
          Catégorie : <%= c.getCategoriehabitat() %> <br/><br/>
          
          Tarif Annuel :  <%= c.getPrixcontrathabitat() %><br/><br/>
          
          Option Incendie :  <%= t %><br/><br/>
          
          Option Vol :  <%= v %><br/><br/>
          
          Option Dégâts des eaux :  <%= r %><br/><br/>
          
          Option biens précieux :  <%= w %><br/><br/>

          Franchise :  <%= c.getFranchise() %><br/><br/>
        
      </p>
      
     <input value="Retour Sinistre" onclick="self.location.href = 'sinistrehabitat.jsp'" type="button">

      